﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DinhMuc.Public;

namespace DinhMuc.DAL
{
    public class tblQLDonHangDAL
    {
        clsConnect cn = new clsConnect();
        public DataTable bangQLDonHang()
        {
            return cn.LoadTableStore("sp_QLdonhang_sanpham_select");
        }
        public DataTable locNgayLap(tblQLDonHangPublic p)
        {
            int para = 2;
            string[] name = new string[para];
            object[] value = new object[para];
            name[0] = "@tu";
            name[1] = "@den";
            value[0] = p.tu;
            value[1] = p.den;
            return cn.LoadTable_loc("sp_loc_ngay_QLdonhang", name, value, para);
        }
        public int suaTienDo(tblQLDonHangPublic p)
        {
            int para = 2;
            string[] name = new string[para];
            object[] value = new object[para];
            name[0] = "@soDH";
            name[1] = "@tienDo";
            value[0] = p.SoDH;
            value[1] = p.TienDo;
            return cn.UpdateTableStore("sp_donHang_updateTienDo", name, value, para);
        }
        public DataTable LoadToComBoBox_tienDo()
        {
            DataTable dt = cn.LoadTableStore("sp_tienDo_select");
            return dt;
        }
    }
}
